<template>
  <view class="message-tip">
    <image class="tip-icon" :src="icon" />
    <text class="tip-text">{{ text }}</text>
  </view>
</template>

<script setup>
defineProps({
  text: {
    type: String,
    default: '这是一个提示'
  },
  icon: {
    type: String,
    default: '/static/icon/warning.png'
  }
});
</script>

<style scoped>
.message-tip {
  display: inline-flex;
  align-items: center;
  padding: 24rpx 36rpx; /* 更大的内边距 */
  background-color: rgba(0, 0, 0, 0.9);
  border-radius: 50rpx;
  color: #fff;
  font-size: 32rpx; /* 字体放大 */
  font-weight: 500;
  box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.4);
  max-width: 90%;
  white-space: nowrap;
  margin: 20rpx auto;
}

.tip-icon {
  width: 48rpx;  /* 图标更大 */
  height: 48rpx;
  margin-right: 20rpx;
}

.tip-text {
  line-height: 48rpx;
}
</style>
